package RMIBank;

import java.io.*;
import java.rmi.*;
import java.rmi.server.*;

public class ConcreteAccount extends UnicastRemoteObject implements Account, Serializable {

    private String name;
    private double balance = 0;

    public ConcreteAccount(String name) throws RemoteException {
		  super();
        this.name = name;
    }

    public String getName() throws RemoteException {
        return this.name;
    }

    public double getBalance() throws RemoteException {
        return this.balance;
    }

    public void deposit(double amount) throws RemoteException {
        this.balance += amount;
    }

    public void withdraw(double amount) throws RemoteException {
        this.balance -= amount;
    }
}
